//统一管理项目中用户相关的接口
import request from '@/utils/request'
// import type { loginForm, loginResponseData, userResponseData } from './type'
import type { loginForm, loginResponseData, userResponseData } from './type_mock'

enum API {
  LOGIN_URL = '/user/login',
  USERINFO_URL = '/user/info'
}

//对外暴漏请求函数
// 登录的接口
export const reqLogin = (data: loginForm) =>
  request.post<any, loginResponseData>(API.LOGIN_URL, data)

// 获取用户信息的接口 (请求头中携带参数)
export const reqUserInfo = () => request.get<any, userResponseData>(API.USERINFO_URL)
